{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table class=\"ee-notebook-buttons\" align=\"left\"><td>\n",
    "<a target=\"_blank\"  href=\"https://colab.research.google.com/github/giswqs/qgis-earthengine-examples/blob/master/Folium/ee-api-folium-setup.ipynb\">\n",
    "    <img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /> Run in Google Colab</a>\n",
    "</td><td>\n",
    "<a target=\"_blank\"  href=\"https://github.com/giswqs/qgis-earthengine-examples/tree/master/Folium/ee-api-folium-setup.ipynb\"><img width=32px src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /> View source on GitHub</a></td><td>\n",
    "<a target=\"_blank\"  href=\"https://nbviewer.jupyter.org/github/giswqs/qgis-earthengine-examples/blob/master/Folium/ee-api-folium-setup.ipynb\"><img width=26px src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Jupyter_logo.svg/883px-Jupyter_logo.svg.png\" />Notebook Viewer</a></td><td>\n",
    "<a target=\"_blank\"  href=\"https://mybinder.org/v2/gh/giswqs/qgis-earthengine-examples/master?filepath=Folium%2Fee-api-folium-setup.ipynb\"><img width=58px src=\"https://mybinder.org/static/images/logo_social.png\" />Run in binder</a></td></table>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Earth Engine Python API and Folium Interactive Mapping\n",
    "\n",
    "This notebook demonstrates how to setup the [Earth Engine Python API](https://developers.google.com/earth-engine/python_install) in the [Google Colaboratory](https://colab.sandbox.google.com/notebooks/welcome.ipynb) platform (Colab) and provides several examples for visualizing Earth Engine processed data interactively using the [folium](https://github.com/python-visualization/folium) library. This notebook was adapted from the [ Earth Engine Python API example](https://github.com/google/earthengine-api/blob/master/python/examples/ipynb/ee-api-colab-setup.ipynb). \n",
    "\n",
    "**Contact:** Qiusheng Wu (<https://wetlands.io>)\n",
    "\n",
    "**Table of Contents**\n",
    "* [Install Earth Engine API and folium](#install-ee-folium)\n",
    "* [Import Earth Engine API and authenticate](#import-api)\n",
    "* [Static map](#static-map)\n",
    "* [Interactive map](#interactive-map)\n",
    "  * [Add custom basemaps](#add-basemaps)\n",
    "  * [Define add_ee_layer() function](#add-ee-layer)\n",
    "  * [Display ee.Image tiles](#display-ee-image)\n",
    "  * [A complete example](#a-complete-example)\n",
    "* [Chart visualization](#chart-vis)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Install Earth Engine API and folium <a class=\"anchor\" id=\"install-ee-folium\"></a>\n",
    "\n",
    "The Earth Engine API and folium library are installed by default in Google Colaboratory. You only need to install these two Python packages if you are running this notebook using your local Python interpreter.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "!pip install earthengine-api\n",
    "!pip install folium"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Import Earth Engine API and authenticate<a class=\"anchor\" id=\"import-api\"></a>\n",
    "\n",
    "The Earth Engine API is installed by default in Google Colaboratory so requires only importing and authenticating. These steps must be completed for each new Colab session, if you restart your Colab kernel, or if your Colab virtual machine is recycled due to inactivity.\n",
    "\n",
    "### Import the API\n",
    "\n",
    "Run the following cell to import the API into your session."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ee"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Authenticate and initialize\n",
    "\n",
    "Run the `ee.Authenticate` function to authenticate your access to Earth Engine servers and `ee.Initialize` to initialize it. Upon running the following cell you'll be asked to grant Earth Engine access to your Google account. Follow the instructions printed to the cell."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Trigger the authentication flow. You only need to do this once\n",
    "ee.Authenticate()\n",
    "\n",
    "# Initialize the library.\n",
    "ee.Initialize()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Test the API\n",
    "\n",
    "Test the API by printing the elevation of Mount Everest."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Mount Everest elevation (m): 8729\n"
     ]
    }
   ],
   "source": [
    "# Print the elevation of Mount Everest.\n",
    "dem = ee.Image('USGS/SRTMGL1_003')\n",
    "xy = ee.Geometry.Point([86.9250, 27.9881])\n",
    "elev = dem.sample(xy, 30).first().get('elevation').getInfo()\n",
    "print('Mount Everest elevation (m):', elev)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Static map <a class=\"anchor\" id=\"static-map\"></a> \n",
    "\n",
    "`ee.Image` objects can be displayed to notebook output cells. The `IPython.display` module contains the `Image` function, which can display the results of a URL representing an image generated from a call to the Earth\n",
    "Engine `getThumbUrl` function. The following cell will display a thumbnail of the global elevation model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src=\"https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/thumbnails/a83efcc1cdfd60835e6ed06b44440762-f514cd45cea8208bc5bad681682ff9ff:getPixels\"/>"
      ],
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Import the Image function from the IPython.display module. \n",
    "from IPython.display import Image\n",
    "\n",
    "# Display a thumbnail of global elevation.\n",
    "Image(url = dem.updateMask(dem.gt(0))\n",
    "  .getThumbUrl({'min': 0, 'max': 4000, 'dimensions': 512,\n",
    "                'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Interactive map <a class=\"anchor\" id=\"interactive-map\"></a> \n",
    "\n",
    "The [`folium`](https://python-visualization.github.io/folium/)library can be used to display `ee.Image` objects on an interactive [Leaflet](https://leafletjs.com/) map. Folium has no default method for handling tiles from Earth Engine, so one must be definedand added to the `folium.Map` module before use.\n",
    "\n",
    "The following cells provide an example of adding a method for handing Earth Engine tiles and using it to display an elevation model to a Leaflet map."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import the folium library.\n",
    "import folium\n",
    "from folium import plugins"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Add custom basemaps <a class=\"anchor\" id=\"add-basemaps\"></a> "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Add custom basemaps to folium\n",
    "basemaps = {\n",
    "    'Google Maps': folium.TileLayer(\n",
    "        tiles = 'https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',\n",
    "        attr = 'Google',\n",
    "        name = 'Google Maps',\n",
    "        overlay = True,\n",
    "        control = True\n",
    "    ),\n",
    "    'Google Satellite': folium.TileLayer(\n",
    "        tiles = 'https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',\n",
    "        attr = 'Google',\n",
    "        name = 'Google Satellite',\n",
    "        overlay = True,\n",
    "        control = True\n",
    "    ),\n",
    "    'Google Terrain': folium.TileLayer(\n",
    "        tiles = 'https://mt1.google.com/vt/lyrs=p&x={x}&y={y}&z={z}',\n",
    "        attr = 'Google',\n",
    "        name = 'Google Terrain',\n",
    "        overlay = True,\n",
    "        control = True\n",
    "    ),\n",
    "    'Google Satellite Hybrid': folium.TileLayer(\n",
    "        tiles = 'https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}',\n",
    "        attr = 'Google',\n",
    "        name = 'Google Satellite',\n",
    "        overlay = True,\n",
    "        control = True\n",
    "    ),\n",
    "    'Esri Satellite': folium.TileLayer(\n",
    "        tiles = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n",
    "        attr = 'Esri',\n",
    "        name = 'Esri Satellite',\n",
    "        overlay = True,\n",
    "        control = True\n",
    "    )\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Define add_ee_layer() function <a class=\"anchor\" id=\"add-ee-layer\"></a> "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define a method for displaying Earth Engine image tiles on a folium map.\n",
    "def add_ee_layer(self, ee_object, vis_params, name):\n",
    "    \n",
    "    try:    \n",
    "        # display ee.Image()\n",
    "        if isinstance(ee_object, ee.image.Image):    \n",
    "            map_id_dict = ee.Image(ee_object).getMapId(vis_params)\n",
    "            folium.raster_layers.TileLayer(\n",
    "            tiles = map_id_dict['tile_fetcher'].url_format,\n",
    "            attr = 'Google Earth Engine',\n",
    "            name = name,\n",
    "            overlay = True,\n",
    "            control = True\n",
    "            ).add_to(self)\n",
    "        # display ee.ImageCollection()\n",
    "        elif isinstance(ee_object, ee.imagecollection.ImageCollection):    \n",
    "            ee_object_new = ee_object.mosaic()\n",
    "            map_id_dict = ee.Image(ee_object_new).getMapId(vis_params)\n",
    "            folium.raster_layers.TileLayer(\n",
    "            tiles = map_id_dict['tile_fetcher'].url_format,\n",
    "            attr = 'Google Earth Engine',\n",
    "            name = name,\n",
    "            overlay = True,\n",
    "            control = True\n",
    "            ).add_to(self)\n",
    "        # display ee.Geometry()\n",
    "        elif isinstance(ee_object, ee.geometry.Geometry):    \n",
    "            folium.GeoJson(\n",
    "            data = ee_object.getInfo(),\n",
    "            name = name,\n",
    "            overlay = True,\n",
    "            control = True\n",
    "        ).add_to(self)\n",
    "        # display ee.FeatureCollection()\n",
    "        elif isinstance(ee_object, ee.featurecollection.FeatureCollection):  \n",
    "            ee_object_new = ee.Image().paint(ee_object, 0, 2)\n",
    "            map_id_dict = ee.Image(ee_object_new).getMapId(vis_params)\n",
    "            folium.raster_layers.TileLayer(\n",
    "            tiles = map_id_dict['tile_fetcher'].url_format,\n",
    "            attr = 'Google Earth Engine',\n",
    "            name = name,\n",
    "            overlay = True,\n",
    "            control = True\n",
    "        ).add_to(self)\n",
    "    \n",
    "    except:\n",
    "        print(\"Could not display {}\".format(name))\n",
    "    \n",
    "# Add EE drawing method to folium.\n",
    "folium.Map.add_ee_layer = add_ee_layer"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Display ee.Image tiles <a class=\"anchor\" id=\"display-ee-image\"></a> "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgCiAgICAgICAgPHNjcmlwdD4KICAgICAgICAgICAgTF9OT19UT1VDSCA9IGZhbHNlOwogICAgICAgICAgICBMX0RJU0FCTEVfM0QgPSBmYWxzZTsKICAgICAgICA8L3NjcmlwdD4KICAgIAogICAgPHNjcmlwdCBzcmM9Imh0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9ucG0vbGVhZmxldEAxLjUuMS9kaXN0L2xlYWZsZXQuanMiPjwvc2NyaXB0PgogICAgPHNjcmlwdCBzcmM9Imh0dHBzOi8vY29kZS5qcXVlcnkuY29tL2pxdWVyeS0xLjEyLjQubWluLmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL21heGNkbi5ib290c3RyYXBjZG4uY29tL2Jvb3RzdHJhcC8zLjIuMC9qcy9ib290c3RyYXAubWluLmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2NkbmpzLmNsb3VkZmxhcmUuY29tL2FqYX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AgICAgICAgICAgIDxkaXYgY2xhc3M9ImZvbGl1bS1tYXAiIGlkPSJtYXBfODBlM2QwMzEyODc3NDdkZTk5NTZiY2YxNzY0MzUwMzAiID48L2Rpdj4KICAgICAgICAKPC9ib2R5Pgo8c2NyaXB0PiAgICAKICAgIAogICAgICAgICAgICB2YXIgbWFwXzgwZTNkMDMxMjg3NzQ3ZGU5OTU2YmNmMTc2NDM1MDMwID0gTC5tYXAoCiAgICAgICAgICAgICAgICAibWFwXzgwZTNkMDMxMjg3NzQ3ZGU5OTU2YmNmMTc2NDM1MDMwIiwKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBjZW50ZXI6IFsyMC4wLCAwLjBdLAogICAgICAgICAgICAgICAgICAgIGNyczogTC5DUlMuRVBTRzM4NTcsCiAgICAgICAgICAgICAgICAgICAgem9vbTogMywKICAgICAgICAgICAgICAgICAgICB6b29tQ29udHJvbDogdHJ1ZSwKICAgICAgICAgICAgICAgICAgICBwcmVmZXJDYW52YXM6IGZhbHNlLAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICApOwoKICAgICAgICAgICAgCgogICAgICAgIAogICAgCiAgICAgICAgICAgIHZhciB0aWxlX2xheWVyX2YyNmQyMzQ5OTdiNTRjYWJiMWEwNzM4ZmI4NWE2ZjE0ID0gTC50aWxlTGF5ZXIoCiAgICAgICAgICAgICAgICAiaHR0cHM6Ly97c30udGlsZS5vcGVuc3RyZWV0bWFwLm9yZy97en0ve3h9L3t5fS5wbmciLAogICAgICAgICAgICAgICAgeyJhdHRyaWJ1dGlvbiI6ICJEYXRhIGJ5IFx1MDAyNmNvcHk7IFx1MDAzY2EgaHJlZj1cImh0dHA6Ly9vcGVuc3RyZWV0bWFwLm9yZ1wiXHUwMDNlT3BlblN0cmVldE1hcFx1MDAzYy9hXHUwMDNlLCB1bmRlciBcdTAwM2NhIGhyZWY9XCJodHRwOi8vd3d3Lm9wZW5zdHJlZXRtYXAub3JnL2NvcHlyaWdodFwiXHU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G9zaXRpb24iOiAidG9wbGVmdCIsICJ0aXRsZSI6ICJGdWxsIFNjcmVlbiIsICJ0aXRsZUNhbmNlbCI6ICJFeGl0IEZ1bGwgU2NyZWVuIn0KICAgICAgICAgICAgKS5hZGRUbyhtYXBfODBlM2QwMzEyODc3NDdkZTk5NTZiY2YxNzY0MzUwMzApOwogICAgICAgIAo8L3NjcmlwdD4=\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7faa12c42710>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Set visualization parameters.\n",
    "vis_params = {\n",
    "  'min': 0,\n",
    "  'max': 4000,\n",
    "  'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}\n",
    "\n",
    "# Create a folium map object.\n",
    "my_map = folium.Map(location=[20, 0], zoom_start=3, height=500)\n",
    "\n",
    "# Add custom basemaps\n",
    "basemaps['Google Maps'].add_to(my_map)\n",
    "basemaps['Google Satellite Hybrid'].add_to(my_map)\n",
    "\n",
    "# Add the elevation model to the map object.\n",
    "my_map.add_ee_layer(dem.updateMask(dem.gt(0)), vis_params, 'DEM')\n",
    "\n",
    "# Add a layer control panel to the map.\n",
    "my_map.add_child(folium.LayerControl())\n",
    "\n",
    "# Add fullscreen button\n",
    "plugins.Fullscreen().add_to(my_map)\n",
    "\n",
    "# Display the map.\n",
    "display(my_map)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### A complete example <a class=\"anchor\" id=\"a-complete-example\"></a> "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWF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3MTI1OSB7CiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAuMCU7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiA1MDAuMHB4OwogICAgICAgICAgICAgICAgICAgIGxlZnQ6IDAuMCU7CiAgICAgICAgICAgICAgICAgICAgdG9wOiAwLjAlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICA8L3N0eWxlPgogICAgICAgIAogICAgPHNjcmlwdCBzcmM9Imh0dHBzOi8vY2RuanMuY2xvdWRmbGFyZS5jb20vYWpheC9saWJzL2xlYWZsZXQuZnVsbHNjcmVlbi8xLjQuMi9Db250cm9sLkZ1bGxTY3JlZW4ubWluLmpzIj48L3NjcmlwdD4KICAgIDxsaW5rIHJlbD0ic3R5bGVzaGVldCIgaHJlZj0iaHR0cHM6Ly9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvbGVhZmxldC5mdWxsc2NyZWVuLzEuNC4yL0NvbnRyb2wuRnVsbFNjcmVlbi5taW4uY3NzIi8+CjwvaGVhZD4KPGJvZHk+ICAgIAogICAgCiAgICAgICAgICAgIDxkaXYgY2xhc3M9ImZvbGl1bS1tYXAiIGlkPSJtYXBfNWIxNDAwNzAwZDFmNDNjMDk1YmUyOWM2NTNkNzEyNTkiID48L2Rpdj4KICAgICAgICAKPC9ib2R5Pgo8c2NyaXB0PiAgICAKICAgIAogICAgICAgICAgICB2YXIgbWFwXzViMTQwMDcwMGQxZjQzYzA5NWJlMjljNjUzZDcxMjU5ID0gTC5tYXAoCiAgICAgICAgICAgICAgICAibWFwXzViMTQwMDcwMGQxZjQzYzA5NWJlMjljNjUzZDcxMjU5IiwKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBjZW50ZXI6IFs0MC4zMywgLTk5LjQyXSwKICAgICAgICAgICAgICAgICAgICBjcnM6IEwuQ1JTLkVQU0czODU3LAogICAgICA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gICAgICAgICAgKS5hZGRUbyhtYXBfNWIxNDAwNzAwZDFmNDNjMDk1YmUyOWM2NTNkNzEyNTkpOwogICAgICAgIAogICAgCiAgICAgICAgICAgIEwuY29udHJvbC5mdWxsc2NyZWVuKAogICAgICAgICAgICAgICAgeyJmb3JjZVNlcGFyYXRlQnV0dG9uIjogZmFsc2UsICJwb3NpdGlvbiI6ICJ0b3BsZWZ0IiwgInRpdGxlIjogIkZ1bGwgU2NyZWVuIiwgInRpdGxlQ2FuY2VsIjogIkV4aXQgRnVsbCBTY3JlZW4ifQogICAgICAgICAgICApLmFkZFRvKG1hcF81YjE0MDA3MDBkMWY0M2MwOTViZTI5YzY1M2Q3MTI1OSk7CiAgICAgICAgCjwvc2NyaXB0Pg==\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7faa12c7af98>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Set visualization parameters.\n",
    "vis_params = {\n",
    "  'min': 0,\n",
    "  'max': 4000,\n",
    "  'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']}\n",
    "\n",
    "# Create a folium map object.\n",
    "my_map = folium.Map(location=[40.33, -99.42], zoom_start=4, height=500)\n",
    "\n",
    "# Add custom basemaps\n",
    "basemaps['Google Maps'].add_to(my_map)\n",
    "basemaps['Google Satellite Hybrid'].add_to(my_map)\n",
    "\n",
    "# Add the elevation model to the map object.\n",
    "my_map.add_ee_layer(dem.updateMask(dem.gt(0)), vis_params, 'DEM')\n",
    "\n",
    "# Display ee.Image\n",
    "dataset = ee.Image('JRC/GSW1_1/GlobalSurfaceWater')\n",
    "occurrence = dataset.select('occurrence');\n",
    "occurrenceVis = {'min': 0.0, 'max': 100.0, 'palette': ['ffffff', 'ffbbbb', '0000ff']}\n",
    "my_map.add_ee_layer(occurrence, occurrenceVis, 'JRC Surface Water')\n",
    "\n",
    "# Display ee.Geometry\n",
    "holePoly = ee.Geometry.Polygon(coords = [[[-35, -10], [-35, 10], [35, 10], [35, -10], [-35, -10]]],\n",
    "                               proj= 'EPSG:4326',\n",
    "                               geodesic = True,\n",
    "                               maxError= 1.,\n",
    "                               evenOdd = False)\n",
    "my_map.add_ee_layer(holePoly, {}, 'Polygon')\n",
    "\n",
    "# Display ee.FeatureCollection\n",
    "fc = ee.FeatureCollection('TIGER/2018/States')\n",
    "my_map.add_ee_layer(fc, {}, 'US States')\n",
    "\n",
    "# Add a layer control panel to the map.\n",
    "my_map.add_child(folium.LayerControl())\n",
    "plugins.Fullscreen().add_to(my_map)\n",
    "\n",
    "# Display the map.\n",
    "display(my_map)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chart visualization <a class=\"anchor\" id=\"chart-vis\"></a> \n",
    "\n",
    "\n",
    "Some Earth Engine functions produce tabular data that can be plotted by\n",
    "data visualization packages such as `matplotlib`. The following example\n",
    "demonstrates the display of tabular data from Earth Engine as a scatter\n",
    "plot. See [Charting in Colaboratory](https://colab.sandbox.google.com/notebooks/charts.ipynb)\n",
    "for more information."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEJCAYAAABlmAtYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOy9eWxl2Z3f9zl3v2/n41IsksVauquq1UupW6rRzNhabHhkyR7YEmABGU+cTOBFsGHBCJwEtmPDjoXYGEwCI/lDgS04kziAB4o9ThwlGVtRMjPSyJ7RdPWi6mW6uquLVSySxeLy9uXuJ3/c914/ssgiWdyrzweQmu8u7573WD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8D/hX4FtmtgfAzIbM7M5wv6eAz5nZUTPLAA83pbQiNShZiDSAu08A3ydoyP57gsbu581shmC+g5vD/X5CkFieDfd5tikFFqlBDdwiIlKTahYiIlKTkoWIiNSkZCEiIjUpWYiISE1KFiIiUpOShYiI1KRkISIiNSlZiIhITf8HCptNeRUO37wAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Import the matplotlib.pyplot module.\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Fetch a Landsat image.\n",
    "img = ee.Image('LANDSAT/LT05/C01/T1_SR/LT05_034033_20000913')\n",
    "\n",
    "# Select Red and NIR bands, scale them, and sample 500 points.\n",
    "samp_fc = img.select(['B3','B4']).divide(10000).sample(scale=30, numPixels=500)\n",
    "\n",
    "# Arrange the sample as a list of lists.\n",
    "samp_dict = samp_fc.reduceColumns(ee.Reducer.toList().repeat(2), ['B3', 'B4'])\n",
    "samp_list = ee.List(samp_dict.get('list'))\n",
    "\n",
    "# Save server-side ee.List as a client-side Python list.\n",
    "samp_data = samp_list.getInfo()\n",
    "\n",
    "# Display a scatter plot of Red-NIR sample pairs using matplotlib.\n",
    "plt.scatter(samp_data[0], samp_data[1], alpha=0.2)\n",
    "plt.xlabel('Red', fontsize=12)\n",
    "plt.ylabel('NIR', fontsize=12)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
